﻿// Decompiled with JetBrains decompiler
// Type: 我的小工具.ListViewSort
// Assembly: 开发辅助工具, Version=1.0.0.1, Culture=neutral, PublicKeyToken=null
// MVID: F78E5980-5E94-4E46-ABDF-DC8C6CBF52AA
// Assembly location: K:\Tools\工具\开发辅助工具庆六一版\开发辅助工具2015-06-01\开发辅助工具.exe

using System.Collections;
using System.Windows.Forms;

namespace 我的小工具
{
  public class ListViewSort : IComparer
  {
    private int col;
    private bool descK;

    public ListViewSort()
    {
      this.col = 0;
    }

    public ListViewSort(int column, object Desc)
    {
      this.descK = (bool) Desc;
      this.col = column;
    }

    public int Compare(object x, object y)
    {
      int num = string.Compare(((ListViewItem) x).SubItems[this.col].Text, ((ListViewItem) y).SubItems[this.col].Text);
      if (this.descK)
        return -num;
      return num;
    }
  }
}
